fix(signals): classify PHP source files as code - #2845
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2845 +/- ##
=======================================
Coverage 96.21% 96.21%
=======================================
Files 256 256
Lines 28051 28051
Branches 10192 10192
=======================================
Hits 26990 26990
Misses 435 435
Partials 626 626
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 23:11:22 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 3 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
isTestPathalready recognizes PHP test files via the PHPUnit/PHPSpecSomethingTest(s)/Specclass-suffix convention, but the sibling
isCodeFilepredicate was never given the matchingphpsource extension. A PHP source file was therefore classified as neither test nor code — the exact
failure
isCodeFile's own comment says it guards against, and the same inconsistency that #2743resolved for the JVM/C#/Swift set.
This adds
phptoisCodeFilein both synced copies (src/signals/local-branch.tsand itskept-in-sync mirror in
src/signals/engine.ts), so PHP source now counts as genuine code in the localscorer's
sourceLineCount, themissing_testssignal,classifyChangedFile, and the slop code-filecounts. A
PaymentTest.phpfile stays a test (the!isTestFileguard still excludes it).No linked issue: this is a small, self-evident correctness fix — one extension added to two
already-synced deterministic predicates, plus regression tests — mirroring #2743's JVM/C#/Swift
class-suffix alignment. It touches no public behavior, auth, schema, or deploy surface, so it fits the
repo's
preferred(not required) linked-issue policy.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
git diff --check(clean),npm run typecheck(clean), and a focusedtest:coverageover the tests that exercise both changed predicates — 194 related unit tests pass and both changed
lines (and both
&&branches) are covered, socodecov/patchis 100% on this diff.src/-onlydeterministic path-classifier change that touches no UI/API/OpenAPI/MCP/DB/workflow surface, so those
jobs are no-ops for this diff; they run on CI (Linux). The
|phpaddition only widens a regexalternation and adds no new branch.
Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.Notes
fix, so the auth/UI/OpenAPI boxes are N/A.
test/unit/local-branch-file-classifiers.test.ts: PHP source(
UserController.php,PaymentGateway.php) → code; PHP class-suffix test (PaymentTest.php) → notcode.